﻿using System;
using System.Collections.Generic;
using System.Linq;
using Diploma.Models;

namespace DiplomaWeb.Models.CompaniesAndLecturers
{
    public class CompanyListViewModel
    {
        public IEnumerable<CompanyViewModel> Companies { get; set; }

        public void ToViewModel(IEnumerable<Company> companies)
        {
            Companies = companies.Select(r => new CompanyViewModel
                                                  {
                                                      Id = r.Id,
                                                      Name = r.DisplayName
                                                  });
        }
    }
}